/**
 * @author Luc Yriarte
 * 
 * Licence : BSD http://www.opensource.org/licenses/bsd-license.php
 *  
 */
package basicSim;

import java.awt.Graphics;

public class SimView {

	int width, height, focal;
	Graphics graphics;
	
	public Object3D model;
	public boolean drawFacets;
	
	public SimView(Object3D obj, Graphics g, int w, int h, int f) {
		drawFacets = true;
		model = obj;
		graphics = g;
		width = w;
		height = h;
		focal = f;
	}
	
	public void updateView(int w, int h, int f) {
		width = w;
		height = h;
		focal = f;
	}

	public void updateModel() {
		model.setDrawMode(drawFacets ? Object3D.DRAW_FACETS : Object3D.DRAW_WIREFRAME);
		model.update(focal, width, height);
	}

	public void updateGraphics() {
		model.paint(graphics);
	}
	
	public void updateGraphics(Graphics g) {
		model.paint(g);
	}
	
}
